package cn.assumejson.springframework.beans.factory.config;

import cn.assumejson.springframework.beans.factory.BeanFactory;
import cn.assumejson.springframework.beans.factory.BeansException;

/**
 * BeanFactory执行 {@link cn.assumejson.springframework.beans.factory.config.BeanFactoryPostProcessor}
 *
 * @author Mr. Li
 * @version 1.0
 * @since 1.0 2021/11/30 15:27
 */
public interface AutowireCapableBeanFactory extends BeanFactory {
    /**
     * 执行 BeanPostProcessors 接口实现类的 postProcessBeforeInitialization 方法
     *
     * @param existingBean existingBean
     * @param beanName     beanName
     * @return
     * @throws BeansException
     */
    Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName) throws BeansException;

    /**
     * 执行 BeanPostProcessors 接口实现类的 postProcessorsAfterInitialization 方法
     *
     * @param existingBean existingBean
     * @param beanName     beanName
     * @return
     * @throws BeansException
     */
    Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName) throws BeansException;

}
